<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head th:include="common/admin-header"></head>

<body class="app sidebar-mini rtl">
<div th:include="common/admin-sadbar"></div>

<main class="app-content">
    <div class="app-title">
        <div>
            <h1><i class="fa fa-th-list"></i> 博客列表</h1>
            <p>Table to display analytical data effectively</p>
        </div>
        <ul class="app-breadcrumb breadcrumb side">
            <li class="breadcrumb-item"><i class="fa fa-home fa-lg"></i></li>
            <li class="breadcrumb-item">Tables</li>
            <li class="breadcrumb-item active"><a href="/admin/blog">博客列表</a></li>
        </ul>
    </div>
    <div class="row">
        <div class="col-md-12">
            <div class="tile">
                <div class="tile-body">
                    <table class="table table-hover table-bordered" style="white-space: nowrap" id="sampleTable">
                        <thead>
                        <tr>
                            <th th:class="text-center">标题</th>
                            <th th:class="text-center">创建人</th>
                            <th th:class="text-center">类别</th>
                            <th th:class="text-center">创建日期</th>
                            <th th:class="text-center">是否置顶</th>
                            <th th:class="text-center">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="blog:${blogs}">
                            <td><a th:text="${blog.getTitle()}" th:href="'/blog/' + ${blog.getId()} ">title</a></td>
                            <td th:text="${blog.getAuthor()}" th:class="text-center">user id</td>
                            <td th:text="${blog.getClassname()}" th:class="text-center">class id</td>
                            <td th:text="${blog.getCreatetime()}">create time</td>
                            <td th:text="${blog.getIstop()}" th:class="text-center">is top</td>
                            <td th:class="text-center">
                                <a th:href="'/admin/blog/edit/' + ${blog.getId()}" class="btn btn-sm btn-info">修改</a>
                                <a class="btn btn-sm btn-danger" th:href="'/admin/blog/del/' + ${blog.getId()}"
                                   onclick="return confirm('文章将被删除，确认删除？');">删除</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>

                </div>
            </div>
        </div>
    </div>
</main>
<!-- Essential javascripts for application to work-->
<script src="/valires/js/jquery-3.2.1.min.js"></script>
<script src="/valires/js/popper.min.js"></script>
<script src="/valires/js/bootstrap.min.js"></script>
<script src="/valires/js/main.js"></script>
<!-- The javascript plugin to display page loading on top-->
<script src="/valires/js/plugins/pace.min.js"></script>
<script type="text/javascript" src="/valires/js/plugins/bootstrap-notify.min.js"></script>
<script type="text/javascript" src="/valires/js/plugins/sweetalert.min.js"></script>
<!-- Data table plugin-->
<script type="text/javascript" src="/valires/js/plugins/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/valires/js/plugins/dataTables.bootstrap.min.js"></script>

<script type="text/javascript">$('#sampleTable').DataTable();</script>

</body>
</html>